@page "/photo"
@using Microsoft.JSInterop
@inject IPhotoService _photoService
@inject IPoetrilizationService _poetrilizationService
@inject IJSRuntime _jsRuntime

<div class="row">
    <div class="col-auto">
        <Button OnClick="CaptureAsync">拍照</Button>
    </div>
    <div class="col-auto">
        <Button OnClick="PickAsync">选图</Button>
    </div>
</div>

@if (_isPhotoAvailable) {
    <div class="shim-lg" />
    <div style="background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); padding: 1.5em; color: white">
        @if (_isLoading) {
            <h1>
                <Spinner></Spinner>
            </h1>
        } else {
            <h1>@_poetry</h1>
        }
    </div>
    <img id="image"
         class="w-100"/>
    <div class="shim-xs"></div>
}